<template>
  <div>
    <p :class="{redStr:bool}">值为true，key作为类名</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      bool:true
    }
  }
}
</script>

<style>
  .redStr{
    color: red;
  }
</style>